package com.aisino.controller;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.aisino.service.KpInvoiceService;

@RequestMapping("/kp")
@Controller
public class KpController {
	
	@Resource
	KpInvoiceService kpInvoiceService;
	
	@RequestMapping("/kp")
	@ResponseBody
	public String kp(HttpServletRequest request){
		String ohids = "20181023140819275_7Iz4i_cf_011";
		List<String> ids = new ArrayList<>();
		if (ohids != null && !"".equals(ohids)) {
			for (String ohid : ohids.split(",")) {
				ids.add(ohid);
			}
		}
		String msg = "";
		if (ids.size() > 0) {
			for (String id : ids) {
				msg = msg+kpInvoiceService.save_taxserverKp(id);
			}
		}
		System.out.println(msg);
		return msg;
	}
	
	@RequestMapping("/zfkp")
	@ResponseBody
	public String zfKp(HttpServletRequest request){
		String ohids = "20181023140819275_7Iz4i_cf_021";
		List<String> ids = new ArrayList<>();
		if (ohids != null && !"".equals(ohids)) {
			for (String ohid : ohids.split(",")) {
				ids.add(ohid);
			}
		}
		String msg = "";
		if (ids.size() > 0) {
			for (String id : ids) {
				msg = msg+kpInvoiceService.save_taxserverZfKp(id);
			}
		}
		System.out.println(msg);
		return msg;
	}

}
